<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
  <div id="root"></div>
  <script>
    const myPlugin={
      install(app,options){
        console.log(app,options);
        app.provide('name','Lee')
        app.directive('focus',{
          mounted(el){
            el.focus() 
          }
        })
        app.mixin({
          mounted(){
            console.log('mixin');
          }
        })
        app.config.globalProperties.$sayHello = 'hello world';
      }
    }
    const app = Vue.createApp({
    
      template:`<mytitle/>`
    });

    app.component('mytitle', {
      inject:['name'],
      mounted(){
        console.log(this.$sayHello);
      },
      template:`<div>{{name}}<input v-focus /></div>`
    });
    app.use(myPlugin,{name:'dell'})
   
    const vm = app.mount('#root');
  </script>
</body>

</html>